package com.jxm.vo;

/**
 * 统一给前端返回数据格式
 * @author dell
 *
 */
public class IResult {
	
	private int code;
	private String msg;
	private Object data;
	
	public static IResult succuss(Object data){
		IResult result = new IResult();
		result.setCode(0);
		result.setData(data);
		return result;
	}
	public static IResult succuss(){
		IResult result = new IResult();
		result.setCode(0);
		return result;
	}
	public static IResult failed(String msg){
		return failed(-1,msg);
	}
	public static IResult failed(int code,String msg){
		IResult result = new IResult();
		result.setCode(code);
		result.setMsg(msg);
		return result;
	}
	
	
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	
	
	
}
